package com.yuyu.commons.toolKit;


import lombok.Getter;
import okhttp3.MediaType;

import static com.yuyu.commons.toolKit.HttpUtil.*;


public enum LibTypeEnum {

    VIDEO(701, 3000,"mp4",MEDIA_TYPE_VIDEO),
    RADIO(702, 300,"mp3",MEDIA_TYPE_AUDIO),
    PIC(703, 30,"jpg",MEDIA_TYPE_JPG),
    FILE(704, 30,"doc",MEDIA_TYPE_OBJECT),
    ;

    @Getter
    private Integer libType;
    @Getter
    private Integer timeOut;
    @Getter
    private String format;
    @Getter
    private MediaType mediaType;

    public static LibTypeEnum valueof(Integer key) {
        for (LibTypeEnum e : values()) {
            if (e.getLibType().equals(key)) {
                return e;
            }
        }
        return null;
    }


    LibTypeEnum(Integer libType, Integer timeOut, String format, MediaType mediaType) {
        this.libType = libType;
        this.format = format;
        this.timeOut = timeOut*1000;
        this.mediaType = mediaType;
    }


}
